/*
 * loadCatalog.java
 *
 * Created on March 26, 2007, 7:11 AM
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package edu.byu.isys413.actions;

import javax.servlet.http.*;
import edu.byu.isys413.group1E.data.*;
import edu.byu.isys413.group1E.handlers.*;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;

/**This action class loads in the list of items that can be purchased over the internet
 *
 * @author Kendall Frazier
 */
public class loadCatalog2 implements edu.byu.isys413.web.Action {
    
    /** Creates a new instance of loadCatalog */
    public loadCatalog2() {
    }
    
    /** 
     *Processes this method loads in the catalog of items that the user can purchase from.  It creates an ArrayList of ConceptualBO's
     *which the catalog.jsp can display to the user.  This version of loadCatalog does not clear the transaction.  This one is called if
     *the user wishes to return from a sale checkout to purchase more items before making a payment.
     *
     *@param HttpServletRequest
     *@param HttpServletResponse
     *
     *@return String the name of the jsp to call
     */
    public String process(HttpServletRequest request, HttpServletResponse response) throws Exception {
        HttpSession session = request.getSession();
        SaleHandler sHandler = SaleHandler.getInstance();
        TransactionDAO TXDAO = TransactionDAO.getInstance();
        UpdateController updateController = UpdateController.getInstance();
        
        ArrayList<ConceptualBO> catalog = sHandler.getCatalog();
        
        
        request.setAttribute("catalog", catalog);
                
//        session.setAttribute("catalog", catalog);        
        return "catalog.jsp";
    }//process
    
    
}//loadCatalog class
